<style>
    .weui_msg{
        position: absolute;
        top:0;
        width: 100%;
        height: 100%;
        background-color: #f2f2f2;
    }
</style>
<template>
    <div class="weui_msg" v-if="data.show&&data.type=='login'">
        <div class="weui_icon_area"><i class="weui_icon_msg weui_icon_warn"></i></div>
        <div class="weui_text_area">
            <h2 class="weui_msg_title">登录提示</h2>
            <p class="weui_msg_desc">您的登录信息已失效，请重新登录后再进行该操作</p>
        </div>
        <div class="weui_opr_area">
            <p class="weui_btn_area">
                <a href="javascript:;" class="weui_btn weui_btn_primary" @click="yes">确定</a>
                <a href="javascript:;" class="weui_btn weui_btn_default" @click="cancel">取消</a>
            </p>
        </div>
    </div>
    <div class="weui_dialog_alert" v-if="data.show&&data.type!='login'">
        <div class="weui_dialog">
            <div class="weui_dialog_hd">
                <strong class="weui_dialog_title">{{data.title||'消息'}}</strong>
            </div>
            <div class="weui_dialog_bd">
                {{data.msg}}
            </div>
            <div class="weui_dialog_ft">
                <a href="javascript:;" class="weui_btn_dialog primary" @click="confirm">确定</a>
            </div>
        </div>
    </div>
</template>
<script type="text/ecmascript-6">
    export default {
        props:['data'],
        methods:{
            yes(){
                this.$router.go('/');
            },
            cancel(){
                window.history.back();
            },
            confirm(){
                this.data.show=false;
            }
        }
    }
</script>